<?php 
 	$escuela = $vars['entity'];

 	$title = '<div style="float: right;">' .
				elgg_view('output/url', array(
					'href' => elgg_get_site_url() . 'action/climbia/deleteEscuela?guid=' . $vars['entity']->guid,
					'text' => '<span class="elgg-icon elgg-icon-delete"></span>',
					'is_action' => true,
					'is_trusted' => true,
				))
				. '</div>';
				
	$title .= '<div style="float: right;">' .
			elgg_view('output/url', array(
					'href' => elgg_get_site_url() . 'climbia/addEscuela?escuela_guid=' . $vars['entity']->guid,
					'text' => '<span class="elgg-icon elgg-icon-settings-alt"></span>',
					'is_action' => true,
					'is_trusted' => true,
			))
			. '</div>';
	
	$title .= '<div style="float: right; margin: 0px 5px;">' .
				elgg_view('output/url', array(
					'href' => elgg_get_site_url() . 'climbia/addSector?escuela_guid=' . $vars['entity']->guid,
					'text' => "<input type='button' style='color: white;' class='elgg-button elgg-button-submit' value='Añadir Sector'>",
					'is_action' => true,
					'is_trusted' => true,
				))
				. '</div>';
				
	$title .= elgg_view_title($vars['entity']->title);
	
	$content = "<div style='float:left;'><img src='". $vars['entity']->getIconURL('large') ."'></div>";
	
	if (!($vars['entity']->description == '')){
    	//$content .= elgg_view('output/longtext', array('value' => $vars['entity']->description));
	}
  	if (!($vars['entity']->location == '')){
    	$content .= "<div style='float:right; margin: 0px 0px 0px 10px;padding: 4px;' class='elgg-module-featured'><h4>" . elgg_echo('climbia:location'). "</h4>";
    	$content .= "<img border='0' src='http://maps.google.com/maps/api/staticmap?center={$vars['entity']->location}&zoom=15&size=270x300&markers=size:mid%7Ccolor:0x00FF00%7Clabel:.%7C{$mapcenter}&sensor=false' alt='Output Map'>";
    	$content .= "</div>";
  	}
  	
  	//if (!($vars['entity']->mejorEpoca == '')){
  	$content .= "<div style='min-width: 223px;float:left; margin: 0px 8px;'>";
  		$content .= "<h4>" . elgg_echo('climbia:besttime'). "</h4>" . elgg_view('output/text', array('value' => elgg_echo($vars['entity']->spring))) . " " .
  		elgg_view('output/text', array('value' => elgg_echo($vars['entity']->summer))) . " " .
  		elgg_view('output/text', array('value' => elgg_echo($vars['entity']->fall))) . " " .
  		elgg_view('output/text', array('value' => elgg_echo($vars['entity']->winter))) . "<br><br>";
  	//}
  		$content .= "<h4>" . elgg_echo('climbia:equipment'). "</h4>" . elgg_view('output/text', array('value' => elgg_echo($vars['entity']->sportclimbing))) . " " .
  				elgg_view('output/text', array('value' => elgg_echo($vars['entity']->bouldering))) . " " .
  				elgg_view('output/text', array('value' => elgg_echo($vars['entity']->traditional))) . " " .
  				elgg_view('output/text', array('value' => elgg_echo($vars['entity']->artificial))) . "<br><br>";
  		
  		//$content .= "Equipamiento : " . elgg_view('output/text', array('value' => $vars['entity']->equipamiento)) . "<br>";
  	
  		
  		$content .= "<h4>" . elgg_echo('climbia:province'). "</h4>" . elgg_view('output/text', array('value' => $vars['entity']->provincia)) . "<br><br>";
  		$content .= "<h4>" . elgg_echo('climbia:typeofrock'). "</h4>" . elgg_view('output/text', array('value' => elgg_echo($vars['entity']->tipoRoca))) . "<br><br>";
  		
  		
  		$content .= "</div>";
  		/**
		Cambiar os formularios para que valgan para a edicion tb.
  		 */
  	
    $options = array(
    	'relationship' => 'sectorPerteneceEscuela',
    	'relationship_guid' => $vars['entity']->guid,
    	'inverse_relationship' => TRUE
    );
    
    $entities = elgg_get_entities_from_relationship($options);
    
   
     
    $titulo = '<h3>Sectores:</h3>';
    foreach ($entities as $entity){
    	$url = elgg_get_site_url() . "climbia/verSector?sector_guid=" . $entity->guid;
    	$contSectores .= "<h4><a href='" . $url . "'>" . $entity->title . "</a></h4>";
    }
    
    $content .= elgg_view_module('featured', $titulo, $contSectores);
    
    
    $avatar = elgg_view_entity_icon($escuela , 'medium');

    
    //$content = elgg_view_image_block($avatar, $content);
    
    $content = elgg_view_module('info', $title, $content);

	echo $content;

 
?>
